<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<%@ taglib uri="/WEB-INF/iristaglib.tld" prefix="iris"%>
<!DOCTYPE html>
<html>
<head>
<title>项目审核</title>
<%@ include file="/common/meta.jsp"%>
<style type="text/css">
.right_text{ font-size:14px; line-height:22px; padding-left:30px;}
.right_text span{ color:#F00; font-weight:bold;}
</style>
<script type="text/javascript" src="${res}/js/opinion/opinion.js"></script>
<script type="text/javascript" src="${res}/js/validate/irisvalidator.js"></script>

</head>
<body>
	<div >
   <span id="attach_name"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <div style=""><input type="button" class="do"  value="上一页" onclick="getFlexFile();"/>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="button" class="do"  value="下一页" onclick="getNextFile();"/>&nbsp;&nbsp;&nbsp;</div>
	<br/>
      <div id="prpAttachViewDiv"  frameborder="0"   height="400px" width="1000px" src=""></div>
    </div>
	<script type="text/javascript">
	$("#comment_notconfirm").hide();
	 var curIndex = 1;
	var tempFileCodes = parent.fileCodesTemp;
	var tempFileNames = parent.fileNamesTemp;
	if(tempFileCodes){
		tempFileCodes = tempFileCodes.split(";");
		tempFileNames = tempFileNames.split("|");
	}
	
	function loadPrpFileView(file_code){
		if(file_code == null || file_code == ""){
			$("#prpAttachViewDiv").html("<font color='red'>附件未上传！</font>");
		}else{
			$("#prpAttachViewDiv").load("${ctx}/downattach/get-file-preview-url?fileCode=" + file_code,null,function(){});
		}
	}
	
	
	function getNextFile(){
		$("#notconfirm").removeAttr("checked");
		$("#confirm").removeAttr("checked");
		$("#comment_notconfirm").val("");
		if (curIndex ==  (tempFileCodes.length-1)){ // last one
			scmWarn("已经是最后一页了 ");
		    return;
		}
		curIndex = curIndex+1;
		$("#attach_name").text(tempFileNames[curIndex]);
		loadPrpFileView(tempFileCodes[curIndex]);
	}
	
	function getFlexFile(){
		$("#notconfirm").removeAttr("checked");
		$("#confirm").removeAttr("checked");
		$("#comment_notconfirm").val("");
		if (curIndex ==  1){  // last one
			scmWarn("已经是第一页了 ");
		    return;
		}
		curIndex = curIndex-1;
		$("#attach_name").text(tempFileNames[curIndex]);
		loadPrpFileView(tempFileCodes[curIndex]);
	}
	
	loadPrpFileView(tempFileCodes[1]);
	$("#attach_name").text(tempFileNames[1]);
	
	function setConfirm(obj){
		
		if(obj.value == 1){
			$("#confirm").attr("checked","checked");
			$("#notconfirm").removeAttr("checked");
			parent.$("#confirm_"+tempSeqNo[curIndex]).attr("checked","checked");
			parent.$("#notconfirm_"+tempSeqNo[curIndex]).removeAttr("checked");
			parent.$("#tr_"+tempSeqNo[curIndex]).attr("style","");
			parent.$("#comment_notconfirm_"+tempSeqNo[curIndex]).hide();
			parent.$("#comment_notconfirm_"+tempSeqNo[curIndex]).attr("class","input_text");
			$("#comment_notconfirm").hide();
		}else if(obj.value == 0){
			$("#notconfirm").attr("checked","checked");
			$("#confirm").removeAttr("checked");
			parent.$("#notconfirm_"+tempSeqNo[curIndex]).attr("checked","checked");
			parent.$("#confirm_"+tempSeqNo[curIndex]).removeAttr("checked");
			parent.$("#tr_"+tempSeqNo[curIndex]).attr("style","background:red");
			parent.$("#comment_notconfirm_"+tempSeqNo[curIndex]).show();
			parent.$("#comment_notconfirm_"+tempSeqNo[curIndex]).attr("class","input_text required");
			$("#comment_notconfirm").show();
		}
	}
	function setValue(){
		parent.$("#comment_notconfirm_"+tempSeqNo[curIndex]).val($("#comment_notconfirm").val());
	}
	</script>
</body>
</html>